package org.jtb.quickr;

import java.io.IOException;
import java.io.InputStream;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;

/**
 * Flickr frob response.
 *
 * @see org.jtb.quickr.AuthService#getFrob()
 */
public class FrobResponse extends FlickrResponse {
    private String frobString;
    
    /**
     * Construct a frob from the given stream.
     * @param is The stream.
     * @throws QuickrException If a problem occurs.
     */
    FrobResponse(InputStream is) throws QuickrException{
        super(is);
    }
    
    protected void populate(Element e) {
        Element frobElement = e.getChild("frob");
        if (frobElement != null) {
            frobString = frobElement.getText();
        }
    }

    public String toString() {
        return frobString;
    }
}
